package org.andcool.sensor.location;

import android.location.Criteria;

/**
 * @author Joosun
 * @since 2011-5-12
 */
public class LocationSensorOptions extends Criteria
{
	private static final long MINIMUMTRIGGERTIME_DEFAULT = 1 * 1000;
	private static final long MINIMUMTRIGGERDISTANCE_DEFAULT = 10;

	private boolean mEnabledOnly = true;

	private long mMinimumTriggerTime = MINIMUMTRIGGERTIME_DEFAULT;
	private long mMinimumTriggerDistance = MINIMUMTRIGGERDISTANCE_DEFAULT;

	public LocationSensorOptions()
	{

	}

	public LocationSensorOptions(final int pAccuracy, final boolean pAltitudeRequired, final boolean pBearingRequired, final boolean pCostAllowed, final int pPowerRequirement, final boolean pSpeedRequired, final boolean pEnabledOnly, final long pMinimumTriggerTime, final long pMinimumTriggerDistance)
	{
		this.mEnabledOnly = pEnabledOnly;
		this.mMinimumTriggerTime = pMinimumTriggerTime;
		this.mMinimumTriggerDistance = pMinimumTriggerDistance;

		this.setAccuracy(pAccuracy);
		this.setAltitudeRequired(pAltitudeRequired);
		this.setBearingRequired(pBearingRequired);
		this.setCostAllowed(pCostAllowed);
		this.setPowerRequirement(pPowerRequirement);
		this.setSpeedRequired(pSpeedRequired);
	}

	public void setEnabledOnly(final boolean pEnabledOnly)
	{
		this.mEnabledOnly = pEnabledOnly;
	}

	public boolean isEnabledOnly()
	{
		return this.mEnabledOnly;
	}

	public long getMinimumTriggerTime()
	{
		return this.mMinimumTriggerTime;
	}

	public void setMinimumTriggerTime(final long pMinimumTriggerTime)
	{
		this.mMinimumTriggerTime = pMinimumTriggerTime;
	}

	public long getMinimumTriggerDistance()
	{
		return this.mMinimumTriggerDistance;
	}

	public void setMinimumTriggerDistance(final long pMinimumTriggerDistance)
	{
		this.mMinimumTriggerDistance = pMinimumTriggerDistance;
	}
}